#include <iostream>
#include <cstring>
#include "cd.h"
using namespace std;

Cd::Cd()
{
    performers[0]=0;
    label[0]=0;
    selections=0;
    playtime=0;
}

Cd::Cd(const char *s1, const char *s2, int n, double x)
{
    // performers=new char[strlen(s1)+1];
    strcpy(performers, s1);
    strcpy(label, s2);
    selections=n;
    playtime=x;
}

Cd::Cd(const Cd &d)
{
    strcpy(performers, d.performers);
    strcpy(label, d.label);
    selections=d.selections;
    playtime=d.playtime;
}

void Cd::Report()
{
    cout<<"************"<<endl;
    cout<<"performers: "<<performers<<endl;
    cout<<"labels: "<<label<<endl;
    cout<<"selections: "<<selections<<endl;
    cout<<"playtime: "<<playtime<<endl;
    cout<<"************"<<endl;
}

Cd &Cd::operator=(const Cd &d)
{
    if (this == &d)
        return *this;
    performers[0]=0;
    label[0]=0;
    selections=0;
    playtime=0;
    // label = new char[std::strlen(rs.label) + 1];
    strcpy(performers, d.performers);
    strcpy(label, d.label);
    selections=d.selections;
    playtime=d.playtime;
    return *this;
}

Classic::Classic():Cd()
{
    info[0]=0;
}
Classic::Classic(const char *s1, const char *s2, const char *s3, int n, double x):Cd(s2, s3, n, x)
{
    strcpy(info, s1);
}
void Classic::Report()
{
    cout<<"************"<<endl;
    cout<<"info: "<<info<<endl;
    Cd::Report();
}